package com.example.snakefinal;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Point;

public class Banana extends Food {

    Banana(Context context, Point location, int size) {
        this.mSpawnRange = location;
        this.mSize = size;
        // Hide the apple off-screen until the game starts
        this.value = 10;
        // Load the image to the bitmap
        this.mBitmap = BitmapFactory.decodeResource(context.getResources(), R.drawable.banana);
        this.mBitmap = Bitmap.createScaledBitmap(this.mBitmap, size, size, false);
        this.spawn();
    }

    @Override
    public void applyMod(SnakeGame game, Snake snake) {
        if (snake.getLives() < 3) {
            snake.setLives(snake.getLives() + 1);
        }
        snake.increaseScore(value);
        this.spawn();
    }
}
